home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / ilisp / ilisp-def.el.z / ilisp-def.el
Encoding:
Text File  |  1998-05-21  |  13.3 KB  |  379 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-def.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.8
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
  11. ;;;               1996 Marco Antoniotti and Rick Campbell
  12. ;;;
  13. ;;; Other authors' names for which this Copyright notice also holds
  14. ;;; may appear later in this file.
  15. ;;;
  16. ;;; Send mail to 'ilisp-request@naggum.no' to be included in the
  17. ;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
  18. ;;; mailing list were bugs and improvements are discussed.
  19. ;;;
  20. ;;; ILISP is freely redistributable under the terms found in the file
  21. ;;; COPYING.
  22.  
  23.  
  24.  
  25. ;;;
  26. ;;; ILISP defvar's
  27. ;;;
  28.  
  29. ;;;%Variables
  30. ;;;%%Deflocal
  31. (defvar ilisp-locals '(comint-prompt-regexp 
  32.                input-ring-size
  33.                comint-get-old-input
  34.                comint-input-sentinel
  35.                comint-input-filter
  36.                comint-input-sender
  37.                comint-eol-on-send
  38.                comint-send-newline
  39.                comint-always-scroll
  40.                comint-fix-error
  41.                comint-continue
  42.                comint-interrupt-regexp
  43.                comint-error-regexp
  44.                comint-output-filter
  45.                comint-interrupt-start
  46.                comint-handler
  47.                comint-update-status
  48.                comint-prompt-status
  49.                comint-abort-hook)
  50.   "List of ilisp local variables.")
  51. (defun lisp-deflocal (local)
  52.   (if (not (memq local ilisp-locals))
  53.       (setq ilisp-locals (cons local ilisp-locals))))
  54.  
  55.  
  56. ;;;
  57. (defmacro deflocal (variable default &optional documentation)
  58.   "Define an ilisp local variable."
  59.   (` (progn (lisp-deflocal '(, variable))
  60.         (defvar (, variable) (, default) (, documentation)))))
  61.  
  62. ;;;%%Simple customization
  63. (defvar ilisp-prefix "\C-c" "Prefix sequence for ilisp commands.")
  64.  
  65. (deflocal ilisp-program nil
  66.   "*Program and arguments for invoking an inferior LISP.  The program
  67. can be an rsh to run on a remote machine.  If there is not a common
  68. file system, the interface files will be sent down the pipe instead.
  69. The value of this variable is set from DIALECT-program, or inherited
  70. from a less specific dialect if DIALECT-program is nil.")
  71.  
  72. (defvar ilisp-motd 
  73.   "ILISP V%s  Use M-x ilisp-bug for problems and suggestions."
  74.   "*Message of the day format string for ILISP given VERSION. To
  75. prevent any message from being printed, set this to nil.")
  76.  
  77. (defvar lisp-wait-p nil
  78.   "*T if LISP eval/compile commands should wait for the result.  A
  79. minus prefix to the command will change the sense of this switch for
  80. just the next command.")
  81.  
  82. (defvar lisp-no-popper 'message
  83.   "*T if you want all output in the inferior LISP rather than in a
  84. pop-up window.  'message if you want output of one line to go to the
  85. message window (or to the inferior LISP if more).  You should probably
  86. also set comint-always-scroll to T as well so that output is always visible.")
  87.  
  88. (defvar lisp-show-status t 
  89.   "*Set to nil to stop showing process status in lisp-mode buffers.")
  90.  
  91. (defvar ilisp-prefix-match nil
  92.   "*Set to T to match only as a prefix when completing through the
  93. inferior LISP.  This will speed up completion, but you no longer get
  94. partial completion.") 
  95.  
  96. (deflocal ilisp-filter-regexp nil
  97.   "*What not to save on an inferior LISP's input history.
  98. Input matching this regexp is not saved on the input history in ilisp
  99. mode.")
  100.  
  101. (deflocal ilisp-filter-length 3
  102.   "*Do not save strings less than this in the command history.")
  103.  
  104. (deflocal ilisp-other-prompt nil
  105.   "*Regexp to recognise prompts in the inferior LISP that are prompts
  106. of non-(read/eval/print) top-levels so that bol-ilisp skips them.")
  107.  
  108. (deflocal ilisp-raw-echo nil
  109.   "*Set this to T to cause echoing in raw keyboard mode.")
  110.  
  111. (deflocal ilisp-load-no-compile-query nil
  112.   "*Set this to T to stop load querying about compile.")
  113.  
  114. ;;;%%%Hooks
  115. (defvar ilisp-site-hook nil
  116.   "Hook for site customization of ilisp mode when it is loaded.")
  117.  
  118. (defvar ilisp-load-hook '()
  119.   "Hook for customizing ilisp mode when it is loaded.")
  120.  
  121. (defvar ilisp-mode-hook '()
  122.   "Hook for customizing ilisp mode.")
  123.  
  124. (deflocal ilisp-init-hook nil
  125.   "Hook of functions to call on first prompt in inferior LISP.")
  126.  
  127. ;;;%%Advanced customization
  128. ;;;%%%Commands
  129. (deflocal ilisp-reset nil
  130.   "String for resetting the top-level of the inferior LISP.")
  131.  
  132. (deflocal ilisp-load-or-send-command nil
  133.   "Format string for loading BINARY if possible otherwise loading
  134. FILE.  If you can't load either, return NIL.")
  135.  
  136. (deflocal ilisp-package-regexp nil
  137.   "Regular expression for finding a package specification in a buffer.
  138. The entire sexp starting with this pattern will be passed to
  139. ilisp-package-command to find the package.")
  140.  
  141. (deflocal ilisp-package-command nil
  142.   "Format string to find the package given PACKAGE.")
  143.  
  144. (deflocal ilisp-package-name-command nil
  145.   "Format string to return the name of the current package.")
  146.  
  147. (deflocal ilisp-in-package-command nil
  148.   "Format string to set the package given PACKAGE.")
  149.  
  150. (deflocal ilisp-last-command nil
  151.   "Format string for getting the last returned value.")
  152.  
  153. (deflocal ilisp-save-command nil
  154.   "Format string for saving result history given FORM.")
  155.  
  156. (deflocal ilisp-restore-command nil
  157.   "Format string for restoring result history.")
  158.  
  159. (deflocal ilisp-block-command nil
  160.   "Format string for grouping FORMS into one.")
  161.  
  162. (deflocal ilisp-eval-command nil
  163.   "Format string for evaluating FORM in PACKAGE from FILE.")
  164.  
  165. (deflocal ilisp-defvar-regexp nil
  166.   "Regular expression for identifying a defvar form.")
  167.  
  168. (deflocal ilisp-defvar-command nil
  169.   "Format string for re-evaluating DEFVAR in PACKAGE from FILE.")
  170.  
  171. (deflocal ilisp-describe-command nil
  172.   "Format string for describing FORM in PACKAGE.")
  173.  
  174. (deflocal ilisp-compile-command nil
  175.   "Format string for compiling FORM in PACKAGE.")
  176.  
  177. (deflocal ilisp-inspect-command nil
  178.   "Format string for inspecting FORM in PACKAGE.")
  179.  
  180. (deflocal ilisp-arglist-command nil
  181.   "Format string for arglist of SYMBOL in PACKAGE.")
  182.  
  183. (deflocal ilisp-documentation-types nil
  184.   "((\"type\") ...) possible LISP documentation types.")
  185.  
  186. (deflocal ilisp-documentation-command nil
  187.   "Format string for documentation given SYMBOL in PACKAGE and TYPE.")
  188.  
  189. (deflocal ilisp-macroexpand-1-command nil
  190.   "Format string for top-level macroexpand given FORM and PACKAGE.")
  191.  
  192. (deflocal ilisp-macroexpand-command  nil
  193.   "Format string for macroexpand given FORM and PACKAGE.")
  194.  
  195. (deflocal ilisp-complete-command nil
  196.   "Format string for finding possibly matching symbols given SYMBOL,
  197. PACKAGE, FUNCTIONP, EXTERNALP and PARTIAL-MATCHP.  It should print
  198. ((string) (string) ...).")
  199.  
  200. (deflocal ilisp-callers-command nil
  201.   "Format for finding the callers of SYMBOL in PACKAGE.  The function
  202. should print out callers with one per line.")
  203.  
  204. (deflocal ilisp-trace-command nil
  205.   "Format for tracing SYMBOL in PACKAGE.")
  206. (deflocal ilisp-untrace-command nil
  207.   "Format for untracing SYMBOL in PACKAGE.")
  208.  
  209. (deflocal ilisp-directory-command nil
  210.   "Format for getting default DIRECTORY.")
  211. (deflocal ilisp-set-directory-command nil
  212.   "Format for setting default DIRECTORY.")
  213.  
  214. (deflocal ilisp-binary-command nil
  215.   "Command to return the extension for binary files.")
  216.  
  217. (deflocal ilisp-binary-extension nil
  218.   "*The extension to use for LISP binaries.  If there is an
  219. ilisp-binary-command, this string will be determined at initilization time.")
  220.  
  221. (deflocal ilisp-init-binary-command nil
  222.   "Command to return the extension for initialization binary files.")
  223.  
  224. (deflocal ilisp-init-binary-extension nil
  225.   "The extension for initialization binary files.  If there is an
  226. ilisp-init-binary-command, this string will be determined at
  227. initilization time.")
  228.  
  229. (deflocal ilisp-load-command nil
  230.   "Format string for loading a file in LISP given FILE.")
  231.  
  232. (deflocal ilisp-compile-file-command nil
  233.   "Format string for compiling a file in LISP given FILE and EXTENSION.")
  234.  
  235. ;;;%%%%Source
  236. (deflocal ilisp-source-types nil
  237.   "Alist of strings for source types.  The strings can be either
  238. symbols or list expressions since the input accepts symbols or open
  239. ended lists as type specifiers.")
  240.  
  241. (deflocal ilisp-find-source-command nil
  242.   "Format string for finding the source file that defined SYMBOL in
  243. PACKAGE.  It should return NIL if no source is found.")
  244.  
  245. (deflocal ilisp-locator nil
  246.   "Function \(SYMBOL TYPE FIRST-P BACK-P) that finds the next SYMBOL TYPE
  247. definition in the current buffer.  FIRST-P is T the first time it is
  248. called in a buffer.  BACK-P is T to move backwards.")
  249.  
  250. (deflocal ilisp-calls-locator nil
  251.   "Function \(SYMBOL TYPE FIRST-P BACK-P ) that finds calls to SYMBOL
  252. in the current buffer.  FIRST-P is T the first time it is called in a
  253. buffer.  BACK-P is T to move backwards.")
  254.  
  255. (deflocal ilisp-source-directory-fixup-alist
  256.     nil
  257.   "*An alist of (REGEXP . FIXUP-FUNCTION) which will be applied to
  258. lists of source filenames to be used with edit-definitions-list.
  259. FIXUP-FUNCTION takes no arguments and should use replace-match to fix
  260. the filenames.")
  261.  
  262.  
  263. ;;;%%%Misc
  264. (deflocal ilisp-use-map nil "Keymap to use in ILISP mode.")
  265.  
  266. (defvar ilisp-bugs-to "ilisp@naggum.no" "Who to send bug reports to.")
  267.  
  268. (defvar ilisp-modes '(ilisp-mode) "List of all inferior ilisp modes.")
  269. (defvar lisp-source-modes '(lisp-mode scheme-mode)
  270.   "Used to determine if a buffer contains Lisp source code.
  271. If it's loaded into a buffer that is in one of these major modes, it's
  272. considered a lisp source file by find-file-lisp, load-file-lisp and
  273. compile-file-lisp. Used by these commands to determine defaults.")
  274.  
  275. (deflocal ilisp-no-newline nil
  276.   "Set to T to stop ilisp from inserting a newline after a command.")
  277.  
  278. (deflocal ilisp-error-filter nil "Function to filter error output.")
  279. (deflocal ilisp-error-regexp nil "Regular expression to match error.")
  280.  
  281. (deflocal ilisp-symbol-delimiters nil
  282.   "Delimiters found around symbols.")
  283.  
  284. ;;;%%Program
  285. (defvar ilisp-completion-map nil "Keymap for reading ilisp readers.")
  286. (defvar ilisp-epoch-running (and (boundp 'epoch::version) epoch::version)
  287.   "Non-nil if epoch is running.")
  288. (defvar ilisp-version 
  289.   "5.8" ;; ILISP-VERSION marker
  290.   "Interface version.")
  291. (defvar ilisp-directory nil "The directory that ilisp is found in.")
  292. (defvar ilisp-mode-map nil "Key map for ILISP.")
  293. (defvar ilisp-raw-map  nil
  294.   "Keyboard map for sending characters directly to the inferior LISP.")
  295. (defvar ilisp-raw-message "Raw keyboard mode until C-g"
  296.   "Message for how to stop raw mode.")
  297. (defvar ilisp-buffer nil "Name of selected ilisp buffer.")
  298. (defvar ilisp-status nil "Status string for selected ilisp buffer.")
  299. (defvar ilisp-buffers nil "List of ILISP buffers.")
  300. (defvar ilisp-dialects nil "List of ILISP dialects.")
  301.  
  302. (deflocal ilisp-load-inits nil
  303.   "Alist of dialect files to load when initializing an inferior LISP.
  304. By default the file will be loaded from the ilisp-directory.")
  305.  
  306. ;;; This is useful to have a clause in ilisp code like:
  307. ;;; (if (memq 'allegro (ilisp-value 'ilisp-dialect)) 
  308. ;;;     allegro-code
  309. ;;;     normal-code)
  310. (deflocal ilisp-dialect nil
  311.   "List of the dialects that defined the current inferior LISP.")
  312.  
  313. (defvar ilisp-initialized nil
  314.   "List of buffer names that have been initialized.")
  315. (deflocal ilisp-initializing nil
  316.   "Set to T while waiting for inferior LISP to get initialized.")
  317.  
  318. (deflocal ilisp-load-files nil "List of files being loaded.")
  319.  
  320. (defvar lisp-changes nil
  321.   "List of markers for changed forms.")
  322. (deflocal ilisp-pending-changes nil
  323.   "List of changes that are pending, but have not been confirmed yet.")
  324.  
  325. ;;;%%%Completion
  326. ;;; Dynamically bound variables for controlling reading
  327. (defvar ilisp-complete nil "T if in minibuffer completion mode.")
  328. (defvar ilisp-no-complete nil "T if incomplete symbols are allowed.")
  329. (defvar ilisp-table nil "Completion table for ilisp readers.")
  330. (defvar ilisp-paren nil "T if paren is allowed in ilisp readers.")
  331. (defvar ilisp-completion-package nil 
  332.   "Package of buffer requesting completion.")
  333. (defvar ilisp-completion-function-p nil
  334.   "T if only symbols with function values are allowed.")
  335.  
  336. ;;; State variables for ilisp reading
  337. (defvar ilisp-mini-prefix nil "Package and qualification from minibuffer.")
  338. (defvar ilisp-original nil "Original string for ilisp completion.")
  339. (defvar ilisp-original-function-p nil "Function-p for ilisp completion.")
  340. (defvar ilisp-original-table nil "Completion table for ilisp-original.")
  341.  
  342. ;;;%Buffer
  343. ;;;%Packages
  344. (defvar buffer-package 'not-yet-computed "Cached package name.")
  345. (defvar buffer-mode-name nil "Original mode name.")
  346. (defvar lisp-buffer-package nil "T if in lisp-buffer-package.")
  347. (defvar lisp-dont-cache-package nil 
  348.   "If Non-Nil then refind the most recent in-package each time.")
  349.  
  350. ;;;%Globals from ilisp-ext.el
  351. ;;;
  352. (defvar ilisp-ext-load-hook nil "Hook to run when extensions are loaded.")
  353. (defvar left-delimiter "\(" "*Left delimiter for find-unbalanced.")
  354. (defvar right-delimiter "\)" "*Right delimiter for find-unbalanced.")
  355.  
  356. ;;; Copies of ilisp var definitions
  357. (defvar ilisp-complete nil "T when ilisp is in completion mode.")
  358. (defvar ilisp-modes '(ilisp-mode) "List of all inferior ilisp modes.")
  359. (defvar lisp-fill-marker (make-marker)
  360.   "Keeps track of point so that it does not move during a reindent-lisp.")
  361. (defvar ilisp-comment-marker (make-marker)
  362.   "Marker for end of a comment region.")
  363.  
  364.  
  365. (defvar lisp-buffer-file nil 
  366.   "Cons of buffer-file-name and the expanded name.")
  367. (make-variable-buffer-local 'lisp-buffer-file)
  368.  
  369. (defvar ilisp-last-message nil)
  370. (defvar ilisp-last-prompt nil)
  371.  
  372. (defvar lisp-prev-l/c-dir/file nil
  373.   "Saves the (directory . file) pair used in the last find-file-lisp,
  374. load-file-lisp or compile-file-lisp command. Used for determining the
  375. default in the next one.")
  376.  
  377. (defvar ilisp-last-buffer nil
  378.   "The last used LISP buffer.")
  379.